package com.ethink.framework.redis.mq;

import org.springframework.data.redis.core.RedisTemplate;

/**
 * @Author name(Tel : mobile)
 * @Date 2020-08-13 09:46
 **/
public class RedisMqPublisher {

    private RedisTemplate redisTemplate;

    public void publish(String topic, Object message) {
        redisTemplate.opsForList().rightPush(MqRedisRedisConstant.TOPIC_PREFIX + topic, message);
    }

    public void setRedisTemplate(RedisTemplate redisTemplate) {
        this.redisTemplate = redisTemplate;
    }
}
